package com.dartfar.menu.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

//菜单
@Entity
@Table(name="T_Menu")
public class Menu implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	//ID
	private int id;
	//名称
	private String name;
	//链接
	private String target;
	//序号
	private int menuOrder;
	//代码
	private String code;
	//主菜单
	private Menu mainMenu;
	//上级菜单
	private Menu parentMenu;
	//是否子菜单
	private boolean leaf;
	//描述
	private String des;
	//图标
	private String iconCls;

	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTarget() {
		return target;
	}
	public void setTarget(String target) {
		this.target = target;
	}
	public int getMenuOrder() {
		return menuOrder;
	}
	public void setMenuOrder(int menuOrder) {
		this.menuOrder = menuOrder;
	}
	
	@ManyToOne
	@JoinColumn(name="mainMenuId")
	public Menu getMainMenu() {
		return mainMenu;
	}
	public void setMainMenu(Menu mainMenu) {
		this.mainMenu = mainMenu;
	}
	@ManyToOne
	@JoinColumn(name="parentMenuId")
	public Menu getParentMenu() {
		return parentMenu;
	}
	public void setParentMenu(Menu parentMenu) {
		this.parentMenu = parentMenu;
	}

	public String getDes() {
		return des;
	}
	public void setDes(String des) {
		this.des = des;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	
	public boolean isLeaf() {
		return leaf;
	}
	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}

	
}
